cmake_minimum_required(VERSION 3.21.1)

project(Cangyan VERSION 1.0.33 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

find_package(Qt6 REQUIRED COMPONENTS Widgets)
find_package(Qt6 REQUIRED COMPONENTS Network)

qt_standard_project_setup()

set(INCLUDE_DIR "${CMAKE_SOURCE_DIR}/include")
set(SOURCE_DIR "${CMAKE_SOURCE_DIR}/src")
set(QRC_DIR "${CMAKE_SOURCE_DIR}/qrc")

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out")

set(CMAKE_BUILD_TYPE DEBUG)

include_directories(${INCLUDE_DIR})
include_directories(${SOURCE_DIR})
include_directories(${QRC_DIR})

file(GLOB_RECURSE SOURCES
    "${INCLUDE_DIR}/*.hpp"
    "${SOURCE_DIR}/*.cpp"
    "${QRC_DIR}/*.qrc"

)

add_executable(Cangyan ${SOURCES})

target_include_directories(Cangyan PRIVATE ${INCLUDE_DIR})
target_include_directories(Cangyan PRIVATE ${SOURCE_DIR})
target_include_directories(Cangyan PRIVATE ${QRC_DIR})

target_link_libraries(Cangyan PRIVATE Qt6::Widgets)
target_link_libraries(Cangyan PRIVATE Qt6::Network)
